const APIRrror = require('../rest').APIError //错误请求方式
const UserControlers = require('../controllers/UserControls')
const IndexControls = require('../controllers/IndexControls')
const LoginControls = require('../controllers/LoginControls')
const BlogControls = require('../controllers/BlogControls')

module.exports = {
    // index
    'GET /': IndexControls.getIndex,
    'POST /': IndexControls.getIndex,

    // user
    'GET /users/new': UserControlers.userNew,
    'GET /users/detail': UserControlers.userDetail,

    // login
    'GET /login': LoginControls.toLogin,
    'POST /login': LoginControls.login,
    'GET /login/status': LoginControls.getStatus,
    'GET /login/userInfo': LoginControls.userInfo,
    'POST /login/out': LoginControls.out,

    // blog
    'POST /blog/new': BlogControls.new,
    'GET /blog/list': BlogControls.list,
    'GET /blog/collect': BlogControls.collect,
    'POST /blog/getCollectStatus': BlogControls.getCollectStatus,
    'POST /blog/addCollect': BlogControls.addCollect,
    'GET /blog/rank': BlogControls.rank,
    'POST /blog/article': BlogControls.article,
    'GET /blog/user/article': BlogControls.userArticle,
    'POST /blog/article/update': BlogControls.articleUpdate,
    'POST /blog/delete': BlogControls.delete,
}